﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EZCRS.HCMS.SqlClient
{
    public class CFun
    {
        public static int PageSize
        {
            get { return int.Parse(GetValue("gvpagesize").Trim());}
        }
        public static int pagecount( int RecordCount,int PageSize)
        {
            if (RecordCount % PageSize > 0)
                return RecordCount / PageSize + 1;
            else
                return RecordCount / PageSize;
        }

        internal static int pagesize()
        {
             return int.Parse(GetValue("gvpagesize").Trim());
        }

        internal static int pagecount(int RecordCount)
        {
            if (RecordCount % PageSize > 0)
                return RecordCount / PageSize + 1;
            else
                return RecordCount / PageSize;
        }
        private static string GetValue(string name)
        {
            try
            {
                return System.Configuration.ConfigurationManager.AppSettings.Get(name);
            }
            catch { return ""; }
        }
    }
}
